package com.ymttest.business.data;

import java.io.IOException;
import java.util.ArrayList;

import org.apache.http.client.ClientProtocolException;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymt.base.YmatouEasyCall;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymttest.business.service.JUserCallService;
import com.ymttest.utils.TestDataManager;


public class Data201608 {

	public static void main(String[] args) throws JSONException, ClientProtocolException, IOException {
		JUserCallService.UpdateLoginPwd(21159000, "qwer1234");
		//STG 压测数据准备
//		//sellerid
//		YmatouEasyCall ec=new YmatouEasyCall("http://c2clivebizer.ymatou.com/search/homepage/?appkey=3&filter=&fl=countryGroupName,sellerId,isReplay,iSort,countryGroupId,sellerName,countryId&module=live_list&platform=pc&sort=desc(yscore)&term(sellerId,480948)&limit=0,1000", "GET", "PARAM");
//		ec.callService();
//		String data=ec.getReturnData();
//		JSONObject jo=new JSONObject(data);
//		JSONArray hits = jo.getJSONArray("hits");
//		for(int i=0;i<hits.length();i++){
//			JSONObject njo=new JSONObject(hits.get(i).toString());
//			System.out.println(njo.getString("sellerId"));
//		}
		
		//topicid
//		YmatouEasyCall ec=new YmatouEasyCall("http://app.ymatou.com/api/home/gethometopic?userid=1&hometype=1", "GET", "PARAM");
//		ec.callService();
//		String data=ec.getReturnData();
//		JSONObject jo=new JSONObject(data);
//		JSONArray hits = jo.getJSONObject("topic").getJSONArray("items");
//		for(int i=0;i<hits.length();i++){
//			JSONObject njo=new JSONObject(hits.get(i).toString());
//			System.out.println(njo.getString("id"));
//		}
		//activeid 直播列表
//		YmatouEasyCall ec=new YmatouEasyCall("http://c2clivebizer.ymatou.com/search/c2c/?fl=id,isReplay,activityName,content,location,picUrl,brands,sellerName,sellerId,countryId,beginTime,endTime,addTime&limit=0,200&sort=desc(yscore)", "GET", "PARAM");
//		ec.callService();
//		String data=ec.getReturnData();
//		JSONObject jo=new JSONObject(data);
//		JSONArray hits = jo.getJSONArray("hits");
//		System.out.println("id,sellerid");
//		for(int i=0;i<hits.length();i++){
//			JSONObject njo=new JSONObject(hits.get(i).toString());
//			System.out.print(njo.getString("id")+",");
//			System.out.println(njo.getString("sellerId"));
//		}
		//准备key
//		String url="http://ms.ymatou.com:3600/api/getKey/";
//		ArrayList<String> list = new ArrayList<>();
//		for(int i=0;i<10000;i++){
//			list.add("99470b75-0aff-481e-87f9-ee32a7b2e9f3/"+TestDataManager.getRandomUUID().toString());
//		}
//		for (String string : list) {
//			YmatouEasyCall ec=new YmatouEasyCall(url+string, "GET", "PARAM");
//			ec.callService();
//			String data=ec.getReturnData();
//			JSONObject jo=new JSONObject(data);
//			String k = jo.getJSONObject("Data").get("key").toString();
//			TestDataManager.appendFileToLine("k_d.txt",string.substring(string.indexOf("/")+1)+","+k );
//		}
		
		
//		String url="http://couponmarketingbiz.iapi.ymatou.com/api/couponmkting/ReceiveActivityCoupon";
//		String str="{\"userId\":5544,\"deviceId\":\"aaaa\",\"activityname\":\"8db60ca7-a572-4438-b959-249328ce4d8a\"}";
//		YmatouEasyCall ec=new YmatouEasyCall(url, "POST", "JSON");
//		ec.setData(str);
//		ec.callService();
//		String data=ec.getReturnData();
//		System.out.print(data);
	}
	
	
	

	
}
